+Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (gtk_text_view_update_layout_width):
+ Since we add one to the layout's reported width to
+ account for the cursor, we need to subtract one when
+ setting the wrap width for the layout. (Fixes infinite
+ loop (#120325, Federico Crozat)
+
+ * gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
+ Be a bit more careful about rounding when converting
+ wrapped width from Pango units to pixels.
+
2003-08-26 Matthias Clasen <maclas@gmx.de>
Rename GtkMenuMerge to GtkUIManager.
+Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (gtk_text_view_update_layout_width):
+ Since we add one to the layout's reported width to
+ account for the cursor, we need to subtract one when
+ setting the wrap width for the layout. (Fixes infinite
+ loop (#120325, Federico Crozat)
+
+ * gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
+ Be a bit more careful about rounding when converting
+ wrapped width from Pango units to pixels.
+
2003-08-26 Matthias Clasen <maclas@gmx.de>
Rename GtkMenuMerge to GtkUIManager.
+Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (gtk_text_view_update_layout_width):
+ Since we add one to the layout's reported width to
+ account for the cursor, we need to subtract one when
+ setting the wrap width for the layout. (Fixes infinite
+ loop (#120325, Federico Crozat)
+
+ * gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
+ Be a bit more careful about rounding when converting
+ wrapped width from Pango units to pixels.
+
2003-08-26 Matthias Clasen <maclas@gmx.de>
Rename GtkMenuMerge to GtkUIManager.
+Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (gtk_text_view_update_layout_width):
+ Since we add one to the layout's reported width to
+ account for the cursor, we need to subtract one when
+ setting the wrap width for the layout. (Fixes infinite
+ loop (#120325, Federico Crozat)
+
+ * gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
+ Be a bit more careful about rounding when converting
+ wrapped width from Pango units to pixels.
+
2003-08-26 Matthias Clasen <maclas@gmx.de>
Rename GtkMenuMerge to GtkUIManager.
+Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (gtk_text_view_update_layout_width):
+ Since we add one to the layout's reported width to
+ account for the cursor, we need to subtract one when
+ setting the wrap width for the layout. (Fixes infinite
+ loop (#120325, Federico Crozat)
+
+ * gtk/gtktextlayout.c (gtk_text_layout_get_line_display):
+ Be a bit more careful about rounding when converting
+ wrapped width from Pango units to pixels.
+
2003-08-26 Matthias Clasen <maclas@gmx.de>
Rename GtkMenuMerge to GtkUIManager.
LAST_ARG
};
+#define PIXEL_BOUND(d) (((d) + PANGO_SCALE - 1) / PANGO_SCALE)
+
static void gtk_text_layout_init (GtkTextLayout *text_layout);
static void gtk_text_layout_class_init (GtkTextLayoutClass *klass);
static void gtk_text_layout_finalize (GObject *object);
pango_layout_get_extents (display->layout, NULL, &extents);
- display->width = PANGO_PIXELS (extents.width) + display->left_margin + display->right_margin;
+ display->width = PIXEL_BOUND (extents.width) + display->left_margin + display->right_margin;
display->height += PANGO_PIXELS (extents.height);
/* Free this if we aren't in a loop */
#define SCREEN_WIDTH(widget) text_window_get_width (GTK_TEXT_VIEW (widget)->text_window)
#define SCREEN_HEIGHT(widget) text_window_get_height (GTK_TEXT_VIEW (widget)->text_window)
+#define SPACE_FOR_CURSOR 1
+
struct _GtkTextPendingScroll
{
GtkTextMark *mark;
gtk_text_layout_get_size (text_view->layout, &width, &height);
/* Make room for the cursor after the last character in the widest line */
- width++;
+ width += SPACE_FOR_CURSOR;
if (text_view->width != width || text_view->height != height)
{
gtk_text_view_ensure_layout (text_view);
gtk_text_layout_set_screen_width (text_view->layout,
- SCREEN_WIDTH (text_view));
+ MAX (1, SCREEN_WIDTH (text_view) - SPACE_FOR_CURSOR));
}
static void